const mongoose = require('mongoose')
// 创建模式对象 引入模式对象
const Schema = mongoose.Schema

const loginSchema = new Schema({
	phone:String,
    name:String,
    psd:String
})

const registerSchema = new Schema({
    phone:{
    	type:String,
    	unique:true,//唯一
    },
    name:{
    	type:String,
    	required:true
    },
    psd:{
    	type:String,
    	required:true
    }
})

const userModels = {
    login: mongoose.model("user",loginSchema ),
    register:mongoose.model("register",registerSchema)
}

module.exports = userModels